{% load i18n %}
{% load staticfiles %}
<!DOCTYPE>
<html>
<head>
<!--[if IE 6]><html class="ie lt-ie8"><![endif]-->
<!--[if IE 7]><html class="ie lt-ie8"><![endif]-->
<!--[if IE 8]><html class="ie ie8"><![endif]-->
<!--[if IE 9]><html class="ie ie9"><![endif]-->
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>世界，您好！ | 三答不溜</title>
<link rel="shortcut icon" href="http://localhost/favicon.ico" type="image/x-icon" />
  <!--[if lte IE 8]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link rel="stylesheet" href="{% static 'css/style.css' %}" type="text/css" media="screen, projection" />
  <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
   
  <!--[if IE 8]><link href="http://jianshu-prd.b0.upaiyun.com/assets/scaffolding/for_ie-79d1b60ced4f878cbdc0939de55c3be1.css" media="all" rel="stylesheet" /><![endif]-->
  <!--[if lt IE 9]><link href="http://jianshu-prd.b0.upaiyun.com/assets/scaffolding/for_ie-79d1b60ced4f878cbdc0939de55c3be1.css" media="all" rel="stylesheet" /><![endif]-->
  <link rel="apple-touch-icon-precomposed" href="http://jianshu-prd.b0.upaiyun.com/assets/icon114-8e7ddf4d5e0e147eba0d35a809bcc235.png" />
  <link rel='dns-prefetch' href='//s.w.org' />
    <script src="{% static 'js/jquery-1.10.2.min.js' %}"></script>
		<script type="text/javascript">
			window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.2.1\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.2.1\/svg\/","svgExt":".svg","source":{"concatemoji":"\/static\/js\/wp-emoji-release.min.js?ver=4.7.4"}};
			!function(a,b,c){function d(a){var b,c,d,e,f=String.fromCharCode;if(!k||!k.fillText)return!1;switch(k.clearRect(0,0,j.width,j.height),k.textBaseline="top",k.font="600 32px Arial",a){case"flag":return k.fillText(f(55356,56826,55356,56819),0,0),!(j.toDataURL().length<3e3)&&(k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57331,65039,8205,55356,57096),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57331,55356,57096),0,0),c=j.toDataURL(),b!==c);case"emoji4":return k.fillText(f(55357,56425,55356,57341,8205,55357,56507),0,0),d=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55357,56425,55356,57341,55357,56507),0,0),e=j.toDataURL(),d!==e}return!1}function e(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i,j=b.createElement("canvas"),k=j.getContext&&j.getContext("2d");for(i=Array("flag","emoji4"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
		</script>
		<link rel='https://api.w.org/' href='' />
<link rel="alternate" type="application/json+oembed" href="" />
<link rel="alternate" type="text/xml+oembed" href="" />
  <!--[if lte IE 8]><script>window.location.href='http://www.mywpku.com/upgrade-your-browser.html?referrer='+location.href;</script><![endif]--></head>
<body class="output fluid zh cn win" data-js-module="recommendation" data-locale="zh-CN">
<div class="qaq">
<a class="cd" href="{% url 'index' %}">答</a>
	<ul class="m-dropdown">
		<li><a href="{% url 'index' %}">首页</a></li>
		<li><a href="">留言板</a></li>
		<li><a href="">关于</a></li>
		</ul>
		</div>
<div class="navbar navbar-jianshu expanded">
  <div class="dropdown">
      <a class="active logo" href="{% url 'index' %}">
        <b>答</b>
</a>
  </div>
  
</div>            <div class="container">
<div class="article">
<h1 class="single-title" itemprop="name">{{ article.title }}</h1>
        <div class="article-info">
          <span>发表于 <i class="icon-book"></i><a href="" rel="category tag">未分类</a></span>
          <span>{{ article.add_time|date:"Y-m-d" }}</span>
          <span>字数: 39</span>
			<span>阅读量: 4</span>
      </div>
         <section class="entry clearfix" >
             {% autoescape off %}
            {{ article.content }}
             {% endautoescape %}
        </section>
{#        <div class="post-like" id="post-like">#}
{#         <a class="favorite"><i class="icon-heart"></i> 喜欢 <span class="count">#}
{#            {{ fav_nums }}</span>#}
{#        </a>#}
{#        </div>#}
        <div id="post-like" class="post-like">
         <a class="favorite"><i class="icon-heart"></i> 喜欢 <span class="count">
            {{ article.get_fav_nums }}</span></a>
        </div>
		<div class="single-footer">
		<span class="single-category"><i class="icon-tag"></i>分类：
            {% if article.category %}
            <a href="" rel="category tag">{{ article.category }}</a></span><br>
                {% else %}
            <a href="" rel="category tag">未分类</a></span><br>
            {% endif %}
            {% if article.tag %}
                <span class="single-tag"><i class="icon-pencil"></i>标签：{{ article.tag }}</span>
                {% else %}
                <span class="single-tag"><i class="icon-pencil"></i>标签：</span>
            {% endif %}

		<br>
		<div class="prev-next">
				  		  		  </div>
</div>
</div>

<div id="comments">
<h1 class="comment-title">
这篇文章有{{ count }}条评论 </h1>
      <div class="com-1">
    <ol class="commentlist">
        {% for comment in comments %}
      <li class="comments"  id="li-comment-1">
		<div id="comment-1" class="comment-body">
			<img src="http://pete.qiniudn.com/avatar/d7a973c7dab26985da5f961be7b74480-104" class="avatar avatar-104" height="104" width="104">			<div class="comment-head">
				<span class="name"><a href='' rel='external nofollow' class='url'>一位三答不溜评论者</a></span>
												<span class="date"> {{ comment.add_time|date:"Y-m-d H:i:s" }}</span>
				<span class="floor">#1</span>
    <a rel='nofollow' class='comment-reply-link' href='' onclick='return addComment.moveForm( "comment-1", "1", "respond", "1" )' aria-label='回复给一位WordPress评论者'>[REPLY]</a>       </div>
         <div class="comment-entry"><p>{{ comment.content }}<br />

    </div>
        </div>
    </li><!-- #comment-## -->
        {% endfor %}
    </ol>
		<div class="mark-comment"></div>
      <nav class="commentnav">  
                   </nav>
	  </div>
  	
	<div id="respond">
		<h2>
		发表评论<small><a rel="nofollow" id="cancel-comment-reply-link" href="" style="display:none;">点击取消回复</a></small>
		</h2>	
{#		    <form action="" method="post" id="commentform">#}
      		<div>
			<div id="comment-author-info">
<p>
	<label>昵称：</label>
	<input type="text" name="author" id="author" class="commenttext" value="" size="22" tabindex="1" required />
</p>
<p>
	<label>邮箱：</label>
	<input type="text" name="email" id="email" class="commenttext" value="" size="22" tabindex="2" required />
</p>
</div>
	<textarea name="comment" id="comment" tabindex="4" cols="50" rows="8" placeholder="既然路过就来说一句吧"></textarea>
<input class="submit" name="submit" type="submit" id="submit" tabindex="5" value="提交评论" /><input type='hidden' name='comment_post_ID' value='1' id='comment_post_ID' />
<input type='hidden' name='comment_parent' id='comment_parent' value='0' />
</div>

{#		    </form>#}
	<div class="clear"></div>
      </div> 
</div></div></div><a class="go-top"><i class="icon-circle-arrow-up"></i></a>
<footer>
  <div class="copyright">
    ©2012-2014 <a href="/" target="_blank">三答不溜</a>
    <br>
    宁ICP备20140702号-3
  </div>
  <div class="contact">
    <a href="" target="_blank">关于三答不溜</a>
    ·
    关注我们:
    <a href="http://weibo.com/" target="_blank"><i class="icon-weibo"></i></a>
    <a href="https://twitter.com/" target="_blank"><i class="icon-twitter"></i></a>
	
    <br>
    <a href="http://www.google.com/chrome" class="use-chrome">建议使用谷歌的 Chrome 浏览器访问以获得最佳用户体验</a><br><a href="http://windows.microsoft.com/zh-CN/internet-explorer/download-ie" class="upgrade-ie">本网站不支持 IE6/IE7，如果您希望继续使用 IE 浏览器，请升级至IE8及以上版本</a>
  </div>
</footer>

    <script src="{% static 'js/full.js' %}"></script>
<script type="text/javascript" src="{% static 'js/comments-ajax.js' %}"></script>
<script type='text/javascript' src='{% static 'js/wp-embed.min.js' %}'></script>
  </body>
</html>

<script type="text/javascript">
    //添加评论
    $('#submit').on('click', function(){
        var comments = $("#comment").val();
        var author = $("#author").val();
        var email = $("#email").val();
        if(comments == ""){
            alert("评论内容不能为空");
            return ;
        }else if(author == "")
        {
            alert("昵称不能为空");
            return ;
        }else if(email == "")
        {
            alert("邮箱不能为空");
            return ;
        }

        $.ajax({
            cache: false,
            type: "POST",
            url:"{% url 'add_comment' %}",
            data:{'arcticle_id':{{ article.id }}, 'comment':comments, 'author': author, 'email': email},
            async: true,
            dataType: 'json',
            beforeSend:function(xhr, settings){
                xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}");
            },
            success: function(data) {
                if(data.status == 'fail'){
                    if(data.msg == '评论失败，请检查信息是否输入完整！'){
                        alert('请检查信息是否输入完整');
                    }else{
                        alert(data.msg);
                    }

                }else if(data.status == 'success'){
                    window.location.reload();//刷新当前页面.
                }
            }
        });
    });

</script>


<script type="text/javascript">
    //点赞
    $('#post-like').on('click', function(){
        var article_id = {{ article.id }};
        $.ajax({
            cache: false,
            type: "POST",
            url:"{% url 'add_fav' %}",
            data:{'article_id': article_id},
            dataType: 'json',
            async: true,
            beforeSend:function(xhr, settings){
                xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}");
            },
            success: function(data) {
                if(data.status == 'success'){
                    console.log('aaaa')
                    window.location.reload();//刷新当前页面.
                }else{
                    alert('点赞失败');
                }
            }
        });
    });

</script>